package org.geektimes.projects.user.service;

import org.geektimes.projects.user.domain.User;
import org.geektimes.projects.user.repository.InMemoryUserRepository;
import org.geektimes.projects.user.sql.DBConnectionManager;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * @author guozhan
 * @description TODO
 * @date 2021/3/1 17:49
 */

public class UserServiceImpl implements UserService{


    private InMemoryUserRepository repository = new InMemoryUserRepository();

    public UserServiceImpl(InMemoryUserRepository repository) {
        this.repository = repository;
    }


    public UserServiceImpl() {
    }

    @Override
    public boolean register(User user) {

        return repository.save(user);
    }

    @Override
    public boolean deregister(User user) {
        return false;
    }

    @Override
    public boolean update(User user) {
        return false;
    }

    @Override
    public User queryUserById(Long id) {
        return null;
    }

    @Override
    public User queryUserByNameAndPassword(String name, String password) {
        return null;
    }
}
